﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
namespace dzs.Web.distribution
{
    public partial class Show :Web.Admin.BasePage
    {        
        		public string strid=""; 
		protected void Page_Load(object sender, EventArgs e)
		{
			if (!Page.IsPostBack)
			{
				if (Request.Params["id"] != null && Request.Params["id"].Trim() != "")
				{
					strid = Request.Params["id"];
					int did=(Convert.ToInt32(strid));
					ShowInfo(did);
				}
			}
		}
		
	private void ShowInfo(int did)
	{
		dzs.BLL.distribution bll=new dzs.BLL.distribution();
		DataSet ds=bll.GetListdetailv(did);
        //[proid],[projectName],[supplyDate],[mbm],[material],[thisMonthCount],[unit],[unitPrice],[dnum],[reqstate],[reqdate],
        //[dbatch],[aognum],[pinum],[handling],[charges],[linkman],[linkway],[handmode],[dstate],[goodsQualityStatus],[goodsQualityStatusDate],
        
        if (ds.Tables[0].Rows.Count > 0)
        {
            this.lblproid.Text = ds.Tables[0].Rows[0][0].ToString();
            this.lblprojectName.Text = ds.Tables[0].Rows[0][1].ToString();
            if(ds.Tables[0].Rows[0][2].ToString()!="")
            this.lblsupplyDate.Text =DateTime.Parse(ds.Tables[0].Rows[0][2].ToString()).ToLongDateString();
            lblmbm.Text = ds.Tables[0].Rows[0][3].ToString();
            lblmaterial.Text = ds.Tables[0].Rows[0][4].ToString();
            lblunit.Text = ds.Tables[0].Rows[0][6].ToString();
            lblunitPrice.Text = ds.Tables[0].Rows[0][7].ToString();

            this.lbldnum.Text = ds.Tables[0].Rows[0][8].ToString();

            this.lblreqstate.Text = ds.Tables[0].Rows[0][9].ToString();
            if (ds.Tables[0].Rows[0][10].ToString() != "")
                this.lblreqdate.Text = DateTime.Parse(ds.Tables[0].Rows[0][10].ToString()).ToLongDateString();
            this.lbldbatch.Text = ds.Tables[0].Rows[0][11].ToString();
            this.lblaognum.Text = ds.Tables[0].Rows[0][12].ToString();
            this.lblpinum.Text = ds.Tables[0].Rows[0][13].ToString();
            this.lblhandling.Text = ds.Tables[0].Rows[0][14].ToString();
            this.lblcharges.Text = ds.Tables[0].Rows[0][15].ToString();
            this.lbllinkman.Text = ds.Tables[0].Rows[0][16].ToString();
            this.lbllinkway.Text = ds.Tables[0].Rows[0][17].ToString();
            this.lblhandmode.Text = ds.Tables[0].Rows[0][18].ToString();
            lblgoodsQualityStatus.Text = ds.Tables[0].Rows[0][19].ToString();
            if (ds.Tables[0].Rows[0][20].ToString() != "")
                this.lblgoodsQualityStatusDate.Text = DateTime.Parse(ds.Tables[0].Rows[0][20].ToString()).ToLongDateString();
            //[sendStatus],[sendStatusDate],[lastArrivalDate],[lastCheckedDate],[lastInstoreDate],[result],[arrivalAddress],[arrivallinkman],[contactWay]
            
            lblsendStatus.Text = ds.Tables[0].Rows[0][21].ToString();
            if (ds.Tables[0].Rows[0][22].ToString() != "")
                this.lblsendStatusDate.Text = DateTime.Parse(ds.Tables[0].Rows[0][22].ToString()).ToLongDateString();
            
            if (ds.Tables[0].Rows[0][23].ToString() != "")
                this.lbllastArrivalDate.Text = DateTime.Parse(ds.Tables[0].Rows[0][23].ToString()).ToLongDateString();
            if (ds.Tables[0].Rows[0][24].ToString() != "")
                this.lbllastCheckedDate.Text = DateTime.Parse(ds.Tables[0].Rows[0][24].ToString()).ToLongDateString();
            if (ds.Tables[0].Rows[0][25].ToString() != "")
                this.lbllastInstoreDate.Text = DateTime.Parse(ds.Tables[0].Rows[0][25].ToString()).ToLongDateString();
            lblresult.Text = ds.Tables[0].Rows[0][26].ToString();
            lblarrivalAddress.Text = ds.Tables[0].Rows[0][27].ToString();
            lblarrivallinkman.Text = ds.Tables[0].Rows[0][28].ToString();
            lblcontactWay.Text = ds.Tables[0].Rows[0][29].ToString();
            //sname, slink, sphone
            lblsname.Text = ds.Tables[0].Rows[0][30].ToString();
            lblslink.Text = ds.Tables[0].Rows[0][31].ToString();
            lblsphone.Text = ds.Tables[0].Rows[0][32].ToString();

        }

	}


    }
}
